package com.aabte.design.pattern.creational.singleton;

public class ThreadLocalInstanceTest {

    public static void main(String[] args) {

        System.out.println(ThreadLocalInstance.getInstance());
        System.out.println(ThreadLocalInstance.getInstance());
        System.out.println(ThreadLocalInstance.getInstance());

        new Thread(new Runnable() {
            public void run() {
                System.out.println(ThreadLocalInstance.getInstance());
            }
        }).start();

        new Thread(new Runnable() {
            public void run() {
                System.out.println(ThreadLocalInstance.getInstance());
            }
        }).start();


    }

}
